import { app1 as request } from '@/api/request';
// 区县月度评价考核指标
/**
 * @description 计算总分和排名
 * @method Post
 */
export function getMonthCalculate<R, T>(item: any) {
  return request.Post<R, T>('/app1-system/Monthcalculate', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

/**
 * @description 查询所有月度绩效评分信息
 * @method Get
 */
export function getMonthList<R, T>() {
  return request.Get<R, T>('/app1-system/Monthlist');
}

/**
 * @description 新增或更新月度绩效评分信息
 * @method Post
 */
export function getEditMonth<R, T>(item: any) {
  return request.Post<R, T>('/app1-system/Monthsave', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

/**
 * @description 删除月度绩效评分信息
 * @method Delete
 */
export function deleteMonthDetails<R, T>(id: number) {
  return request.Delete<R, T>(`/app1-system/Monthdelete?id=${id}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}
/**
 * @description 根据条件查询月度绩效评分信息
 * @method Post
 */
export function getMonthSearch<R, T>(item: any) {
  return request.Post<R, T>('/app1-system/Monthsearch', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
// 云网部及各中心月度 KPI 考核
/**
 * @description 获取所有云网工作评估指标
 * @method Get
 */
export function getindicators<R, T>() {
  return request.Get<R, T>('/app1-system/getindicators');
}
/**
 * @description 根据部门查询考核数据
 * @method Post
 */
export function queryByConditions<R, T>(mainIndicator: any) {
  return request.Post<R, T>('/app1-system/queryByConditions', mainIndicator, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
/**
 * @description 批量删除云网工作评估指标
 * @method Delete
 */
export function deleteindicators<R, T>(id: number[]) {
  return request.Delete<R, T>('/app1-system/deleteindicators', id, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
/**
 * @description 更新云网工作评估指标
 * @method put
 */
export function updateindicators<R, T>(change: any) {
  return request.Put<R, T>('/app1-system/updateindicators', change, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
/**
 * @description 新增云网工作评估指标
 * @method Post
 */
export function addindicators<R, T>(formState: any) {
  return request.Post<R, T>('/app1-system/addindicators', formState, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

/**
 * @description 区县数据excel文档导出
 * @method Get
 */
export function getKpiExcel<R, T>() {
  return request.Get<R, T>('/app1-system/exportAllApp1YunwangWorkEvaluationIndicatorsData', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    responseType: 'blob',
  });
}
export function getYunWanghistoryExcel<R, T>(month: string) {
  return request.Get<R, T>(`/app1-systemhistory/exportHistoryAssessment/${month}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    responseType: 'blob',
  });
}
export function getQuarterhistoryExcel<R, T>(month: string) {
  return request.Get<R, T>(`/app1-systemhistory/exportHistoryQuarterData/${month}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    responseType: 'blob',
  });
}
export function getMonthhistoryExcel<R, T>(month: string) {
  return request.Get<R, T>(`/app1-systemhistory/exportYunwangHistory/${month}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    responseType: 'blob',
  });
}

// 云网部及各中心月度 KPI 考核详情页面
/**
 * @description 根据SheetName获取云网公共表记录
 * @method Get
 */
export function getyunwangPublicSheetgetBySheetName<R, T>(SheetName: any) {
  return request.Get<R, T>(`/app1-system/yunwangPublicSheetgetBySheetName/${SheetName}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

// 云网工作评估数据
/**
 * @description 单条修改
 * @method Post
 */
export function update<R, T>(change: any) {
  return request.Post<R, T>('/app1-system/update-dates', change, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
/**
 * @description 全部部门考核excel文档导出
 * @method Get
 */
export function getMohthExcel<R, T>() {
  return request.Get<R, T>('/app1-system/exportAllAssessment', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    responseType: 'blob',
  });
}

/**
 * @description 单个部门考核excel文档导出
 * @method Get
 */
export function getMohthExcelByDepartment<R, T>(department: string) {
  return request.Get<R, T>(`/app1-system/exportAssessment/${department}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    responseType: 'blob',
  });
}

// 区县月度评价考核项
/**
 * @description 查询所有考核项
 * @method Get
 */
export function getAssessmentList<R, T>() {
  return request.Get<R, T>('/app1-system/list', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}
export function getdiagramData<R, T>() {
  return request.Get<R, T>('/app1-system/getData', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}
export function getexportWord<R, T>() {
  return request.Get<R, T>('/app1-system/exportWord', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 根据assessedDepartment查询考核项
 * @method Get
 */
export function getAssessmentListByDepartment<R, T>(department: string) {
  return request.Get<R, T>(`/app1-system/bydepartment?assessedDepartment=${department}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 更新考核项
 * @method Put
 */
export function updateAssessment<R, T>(data: any) {
  return request.Put<R, T>('/app1-system/update', data, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

/**
 * @description 根据ID删除考核项
 * @method Delete
 */
export function deleteAssessmentById<R, T>(id: number) {
  return request.Delete<R, T>(`/app1-system/delete/${id}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 添加新的考核项
 * @method POST
 */
export function addAssessment<R, T>(item: any) {
  return request.Post<R, T>('/app1-system/add', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
/**
 * @description 更新云网工作评估指标
 * @method Post
 */
export function search<R, T>(item: any) {
  return request.Post<R, T>('/app1-system/indicators/search', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
// 云网运营部汇总
/**
 * @description 查询所有数据
 * @method POST
 */
export function getQuarterSummaryList<R, T>() {
  return request.Post<R, T>('/app1-system/Yunwanglist', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 季度excel文档导出
 * @method Get
 */
export function getSummaryExcel<R, T>() {
  return request.Get<R, T>('/app1-system/exportAllQuarterData', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    responseType: 'blob',
  });
}

/**
 * @description 根据sheetname获取县分季度指标
 * @method Get
 */
export function getQuarterBySheetName<R, T>(sheetname: string) {
  return request.Get<R, T>('/app1-system/quarterPublicSheetlistbysheetname', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    params: { sheetname },
  });
}

/**
 * @description 更新县分季度指标
 * @method Put
 */
export function updateQuarterPublicSheet<R, T>(item: any) {
  return request.Put<R, T>('/app1-system/quarterPublicSheetupdate', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
export function updateYunwangHistoryRecord<R, T>(item: any) {
  return request.Put<R, T>('/app1-systemhistory/update', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
export function getyunwangPublicSheet<R, T>(id: number) {
  return request.Get<R, T>(`/app1-system/yunwangPublicSheetget/${id}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 根据ID获取县分季度指标
 * @method Get
 */
export function getQuarterPublicSheetById<R, T>(id: number) {
  return request.Get<R, T>(`/app1-system/quarterPublicSheetget/${id}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 删除县分季度指标
 * @method Delete
 */
export function deleteQuarterPublicSheet<R, T>(id: number) {
  return request.Delete<R, T>(`/app1-system/quarterPublicSheetdelete/${id}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 新增云网公共表记录
 * @method POST
 */
export function addYunWangPublicSheetcreate<R, T>(item: any) {
  return request.Post<R, T>('/app1-system/yunwangPublicSheetcreate', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

// 季度

/**
 * @description 新增县分季度指标
 * @method POST
 */
export function addQuarterPublicSheetcreate<R, T>(item: any) {
  return request.Post<R, T>('/app1-system/quarterPublicSheetcreate', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

export function getcountyList<R, T>() {
  return request.Post<R, T>('/app1-system/countylist');
}

export function addcount<R, T>(item: any) {
  return request.Post<R, T>('/app1-system/countycreate', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
export function updatecounty<R, T>(item: any) {
  return request.Put<R, T>('/app1-system/countyupdate', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
export function updatePublicSheetupdate<R, T>(item: any) {
  return request.Put<R, T>('/app1-system/quarterPublicSheetupdate', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
export function updateyunwangPublicSheet<R, T>(newData: any) {
  return request.Put<R, T>('/app1-system/yunwangPublicSheetupdate', newData, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

export function deletecountyDetails<R, T>(id: number) {
  return request.Delete<R, T>(`/app1-system/county/${id}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}
export function deleteyunwangPublicSheetdelete<R, T>(id: number) {
  return request.Delete<R, T>(`/app1-system/yunwangPublicSheetdelete/${id}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}
export function getcountyDetails<R, T>(id: number) {
  return request.Post<R, T>(`/app1-system/county/${id}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

export function getquarterListBysheetname<R, T>(sheetname: string) {
  return request.Get<R, T>(`/app1-system/quarterPublicSheetlistbysheetname?sheetname=${sheetname}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}
export function deletequarterPublicSheet<R, T>(id: number) {
  return request.Delete<R, T>(`/app1-system/quarterPublicSheetdelete/${id}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

// 分析图
/**
 * @description 导出雷达word模板
 * @method Get
 */
export function getExportWord<R, T>() {
  return request.Get<R, T>('/app1-system/exportWord', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    responseType: 'blob',
  });
}

/**
 * @description 导出云网word模板
 * @method Get
 */
export function getExportWord1<R, T>() {
  return request.Get<R, T>('/app1-system/exportWord1', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    responseType: 'blob',
  });
}

// 导入excel文件
/**
 * @description 云网新增sheet导入数据库
 * @method Post
 */
export function addYunwangSheet<R, T>(FormData: any) {
  return request.Post<R, T>('/app1-system/addYunwangSheet', FormData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

/**
 * @description 季度新增sheet导入数据库
 * @method Post
 */
export function addQuarterSheet<R, T>(FormData: any) {
  return request.Post<R, T>('/app1-system/addQuarterSheet', FormData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

/**
 * @description 云网其他sheet导入数据库
 * @method Post
 */
export function addYunwangSheetExcelFileupload<R, T>(FormData: any) {
  return request.Post<R, T>('/app1-system/YunwangSheetExcelFileupload', FormData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

/**
 * @description 云网工作评价指标体系excel文档录入数据库
 * @method Post
 */
export function addYunwangWorkEvaluationIndicatorsFileupload<R, T>(FormData: any) {
  return request.Post<R, T>('/app1-system/App1YunwangWorkEvaluationIndicatorsFileupload', FormData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

/**
 * @description 区县数据excel文档录入数据库
 * @method Post
 */
export function addYunwangWorkEvaluationIndicatorsDataFileupload<R, T>(FormData: any) {
  return request.Post<R, T>('/app1-system/App1YunwangWorkEvaluationIndicatorsDataFileupload', FormData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

/**
 * @description 云网工作评价指标体系+数据excel文档录入数据库
 * @method Post
 */
export function addYunwangWorkEvaluationIndicatorsAndDataFileupload<R, T>(FormData: any) {
  return request.Post<R, T>('/app1-system/App1YunwangWorkEvaluationIndicatorsAndDataFileupload', FormData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

/**
 * @description 季度excel导入数据库
 * @method Post
 */
export function addQuarterPublicSheetFileupload<R, T>(FormData: any) {
  return request.Post<R, T>('/app1-system/App1QuarterPublicSheetFileupload', FormData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

/**
 * @description 各部门月度考核excel导入数据库
 * @method Post
 */
export function addAssessmentFileupload<R, T>(FormData: any) {
  return request.Post<R, T>('/app1-system/App1AssessmentFileupload', FormData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

// 获取历史记录
/**
 * @description 查询全部月度历史记录
 * @method Post
 */
export function getAllMonthList<R, T>(currentPage: number, pageSize: number) {
  return request.Post<R, T>('/app1-systemhistory/queryAllHistory', { currentPage, pageSize }, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 根据年月查询月度历史记录
 * @method Post
 */
export function getMonthDataByYearMonth<R, T>(yearMonth: any) {
  return request.Post<R, T>(`/app1-systemhistory/queryHistoryByYearAndMonth?yearMonth=${yearMonth}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 更新月度历史记录
 * @method Post
 */
export function updateMonthDataByYearMonth<R, T>(item: any) {
  return request.Post<R, T>('/app1-systemhistory/updateHistory', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

/**
 * @description 查询全部kpi历史记录
 * @method Get
 */
export function getAllKpiList<R, T>() {
  return request.Get<R, T>('/app1-systemhistory/list', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 查询kpi历史记录根据年月
 * @method Get
 */
export function getKpiListByYearMonth<R, T>(yearMonth: string) {
  return request.Get<R, T>('/app1-systemhistory/getByYearMonth', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    params: { yearMonth },
  });
}

/**
 * @description 查询全部季度历史记录
 * @method Get
 */
export function getAllQuarterList<R, T>() {
  return request.Get<R, T>('/app1-systemhistory/Quarterlist', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 根据年月查询季度历史记录总表
 * @method Post
 */
export function getZQuarterListByYearMonth<R, T>(yearMonth: string) {
  return request.Post<R, T>(`/app1-systemhistory/QuarterHistoryCountyIndicatorByYearMonth?yearMonth=${yearMonth}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 查询季度历史记录根据年月
 * @method Post
 */
export function getQuarterListByYearMonth<R, T>(yearMonth: string) {
  return request.Post<R, T>(`/app1-systemhistory/QuarterHistoryPublicSheetByYearMonth/?yearMonth=${yearMonth}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 季度历史记录编辑
 * @method Post
 */
export function updateQuarterHistoryRecord<R, T>(item: any) {
  return request.Put<R, T>('/app1-systemhistory/Quarterupdate', item, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

// 定稿
/**
 * @description 定稿月度历史记录
 * @method Post
 */
export function addHistory<R, T>(year: any, item: any) {
  const data = {
    year,
    item,
  };
  return request.Post<R, T>('/app1-systemhistory/addHistory', data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 定稿季度历史记录
 * @method Post
 */
export function Quartercreate<R, T>(year: any) {
  return request.Post<R, T>(`/app1-systemhistory/Quartercreate/${year}`, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

/**
 * @description 查询季度历史记录总表
 * @method Post
 */
export function getQuarterHistoryCountyIndicatorlist<R, T>() {
  return request.Post<R, T>('/app1-systemhistory/QuarterHistoryCountyIndicatorlist', {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}
